#ifndef SCENE_H
#define SCENE_H

#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
//#include <QAbstractGraphicsShapeItem>
#include <QGraphicsItem>
#include <QPolygonF>
#include <QPointF>
#include <vector>
using namespace std;

class Scene : public QGraphicsScene
{
    Q_OBJECT

public:
    explicit Scene(QObject *parent = 0);
    ~Scene();
    char actionType;
    char figureType;
    char changeFigureType;

private:
    QGraphicsItem *ptrCurrentFigure;
    QGraphicsItem *ptrCurrentSelection;

    QPointF centralPoint;
    int a, b;

    QPolygon triangle;

    QPolygonF selectionArea;

    bool pressed;

private:
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
    void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);

signals:
    void signalGetNewFigure(vector<double>, QGraphicsItem*);
    void signalGetSelectionFigures(QList<QGraphicsItem *>);
    void signalGetCoef(pair<double, double>);

public slots:
    void slotEllipseState();
    void slotRectangleState();
    void slotTriangleState();

    void slotExtension();
    void slotShift();
    void slotTurn();
};

#endif // SCENE_H
